package com.zmc.dynamic.controller;

import com.alibaba.fastjson.JSON;
import com.zmc.dynamic.domain.CashConfig;
import com.zmc.dynamic.domain.CashUser;
import com.zmc.dynamic.service.CashConfigService;
import com.zmc.dynamic.service.CashUserService;
import com.zmc.dynamic.util.IdUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.IntStream;

@RestController
@RequestMapping("config/")
public class ConfigController {

    @Resource
    private CashConfigService cashConfigService;

    @RequestMapping("save")
    public String save(){
        CashConfig cashConfig = new CashConfig();
        cashConfig.setOrderId("11111111");
        cashConfig.setCreateBy("zhangSan");
        cashConfig.setUpdateBy("list");
        cashConfigService.save(cashConfig);
        return "ok";
    }

    @RequestMapping("get")
    public String get(){
        List<CashConfig> list = cashConfigService.list();
        return JSON.toJSONString(list);
    }

}
